package com.wlyuan.open.scanner.application.handler.full;

import com.wlyuan.open.dto.OpenPaySyncDTO;
import com.wlyuan.open.scanner.application.annotation.ScannerCode;
import com.wlyuan.open.scanner.assembler.ScannerPayAssembler;
import com.wlyuan.open.scanner.constant.ScannerCodeEnum;
import com.wlyuan.open.scanner.domain.finance.pay.BillPay;
import com.wlyuan.open.scanner.repository.BillPayRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lijing
 * @description
 */
@ScannerCode(code = ScannerCodeEnum.PAY)
@Service
@Slf4j
@RequiredArgsConstructor
public class ScannerBillPayHandler extends BaseScannerHandler<BillPay, OpenPaySyncDTO> {
    private final BillPayRepository billPayRepository;

    @Override
    protected List<BillPay> select() {
        return billPayRepository.list();
    }

    @Override
    protected List<OpenPaySyncDTO> assembler(List<BillPay> data) {
        return ScannerPayAssembler.assemble(data);
    }
}
